/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
   /*Title: mjbWorld
   Copyright (c) 1998-2002 Martin John Baker 

This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General public: License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   GNU General public: License for more details.

For information about the GNU General public: License see http://www.gnu.org/

To discuss this program http://sourceforge.net/forum/forum.php?forum_id=122133
   also see website http://www.euclideanspace.com/
   */

/*
   for theory see:
   http://www.euclideanspace.com/maths/vectors/index.htm
   */
#ifndef SF_VEC_3F_H_
#define SF_VEC_3F_H_
class sfvec3f {
 // public: static bool saveAsDouble;
   public: double x;
   public: double y;
   public: double z;

 // VRML only supports float but allow override if higher resolution required

 public: sfvec3f(double x,double y,double z);

 public: sfvec3f(sfvec3f* in);

 public: sfvec3f();

 public: void sub(sfvec3f* other);
   public: void add(sfvec3f* other);
   public: void normalize();
   public: void scale(double sc);
   public: double distanceSquared(sfvec3f* other);
   void cross(sfvec3f* other);
   double dot(sfvec3f* other);

 static sfvec3f* sub(sfvec3f* a,sfvec3f* b){
   return new sfvec3f(a->x - b->x,a->y - b->y,a->z - b->z);
   }

 
// public: String* ToString();

// public: property* clone();

 /** create an array of the appropriate type
   * with a size given by the parameter
   */
  // public: property* createArray(int size)[];

 public: void setX(double v);

 public: void setY(double v);

 public: void setZ(double v);

 public: double getx();

 public: double gety();

 public: double getz();

 public: sfvec3f* minus();

// public: String* toStatic();

 /* if i=0 take minimum otherwise maximum */
   public: void combine(sfvec3f* bb_current,int i);

 public: bool greaterThan(sfvec3f* other);

 public: bool lessThan(sfvec3f* other);
   public: bool Equals(sfvec3f* v2);




   };
 #endif
 
 
